import { onMounted, watchEffect  } from "vue";
import { radio, targetY } from '@/utils/auto2.js';

export function useResizeBox(el) {
  onMounted(() => {
    el.value.style.height = targetY.value + 'px';
    const w = parseFloat(getComputedStyle(el.value, null)['width']);
    watchEffect(() => {
      //  先整体缩小，然后在根据高度 进行放大
      el.value.style.transform = `scale(${radio.value})`;
      // 重新进行缩放 - 保证 高度占满
    })
  })
}